﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Summerset.Isbndb.Publishers
{
    /// <summary>
    /// Represents details for a <see cref="PublisherElement"/>.
    /// This information must be explicitly requested using the <see cref="PublishersArgs.Results.details"/> argument
    /// when creating a new <see cref="PublishersRequest"/>.
    /// </summary>
    public sealed class PublisherElementDetail : ResponseElementChildBase
    {
        /* Element Example:
         * <Details location="Sebastopol, CA"/>
         */

        #region Constructor + Overridden Properties

        /// <summary>
        /// Initializes a new instance of the <see cref="PublisherElementDetail"/> class.
        /// </summary>
        /// <param name="element">The xml element containing the underlying dat for this instance..</param>
        public PublisherElementDetail(XmlElement element)
            : base(element) { }

        /// <summary>
        /// Gets name of the element that must be provided to this class's constructor.
        /// </summary>
        protected override string ExpectedElementName
        {
            get { return "Details"; }
        }

        #endregion
        #region Properties

        /// <summary>
        /// Gets the location of the publisher.  Typically expressed as 'City', 'State'
        /// </summary>
        public string Location
        {
            get { return _element.Attributes["Location"].Value; }
        }

        #endregion
    }
}
